<%@ page language="java" contentType="text/html; charset=utf-8"%>
<%@page
	import="java.util.List,java.util.Set,java.util.ArrayList,java.util.Map"%>
<%@ page
	import="edu.ccut.saturn.web.SaturnDisplayManager,edu.ccut.saturn.component.SaturnData"%>
<html>
<head>
<link rel="stylesheet"
	href="<%=request.getContextPath()%>/css/dynamic.css" type="text/css">
<script language="javaScript">
function updateCsstheme(){
	main.action = "<%=request.getContextPath()%>/saturnManager::/cssModule/action/UpdateUserCssThemeAction.action";
	main.submit();
}
</script>
<title>css theme 管理</title>
</head>
<body>
<form name="main" method="post"><br>
<br>
<br>
<table class="saturn-table" width="90%" border="1" align="center"
	cellpadding="1" cellspacing="1">
	<tr>
		<td class="saturn-style-title" colspan="3">样式主题管理</td>
	</tr>
	<tr class="">
		<td class=saturn-table-th></td>
		<td class="saturn-table-th" align="center"><span class="STYLE5">用户名</span></td>
		<td class="saturn-table-th" align="center"><span class="STYLE5">样式主题key</span></td>
	</tr>
	<%
				SaturnData user = (SaturnData) session
				.getAttribute("__SATURN_AUTORITY_USER__");
		//String userName = user.getString("username");
		//String user_Serialno = user.getString("id");
		String userName = user.getString("username");
		String user_Serialno = user.getString("id");
		List mapList = (List) request.getAttribute("mapList");
		String userCssTheme = "";
		if (mapList != null) {
			for (int i = 0; i < mapList.size(); i++) {
				Map map = (Map) mapList.get(i);
				if (map.get("USERSERIALNO").toString()
				.equals(user_Serialno)) {
			userCssTheme = map.get("CSSKEY").toString();
			break;
				}
			}
		}
		Set keySet = SaturnDisplayManager.getInstance()
				.getCssProviderMapKeys();
		if (!userCssTheme.equals("")) {
	%>
	<tr class="saturn-tr-odd">
		<td class=saturn-table-th></td>
		<td class="saturn-table-td"><%=userName%> <input type="hidden"
			name="userSerialno" value="<%=user_Serialno%>"></td>
		<td class="saturn-table-td"><select name="theme">
			<%
						if (keySet.size() > 0) {
						Object[] keySetObjects = (Object[]) keySet.toArray();
						for (int i = 0; i < keySetObjects.length; i++) {
					String key = keySetObjects[i].toString();
					if (key.equals(userCssTheme)) {
					
			%>
			<option value="<%=key%>" selected><%=key%></option>
			<%
			} else {
			%>
			<option value="<%=key%>"><%=key%></option>
			<%
			}
			%>
			<%
			}
			%>
			<%
			}
			%>
		</select></td>
	</tr>
	<%
	}
	%>
</table>
<table width="90%" border="0" align="center" cellpadding="1"
	cellspacing="1">
	<tr class="saturn-tr-odd" align="right">
		<td><input class="saturn-input-button" type="button"
			value="更新用户css主题" onclick="updateCsstheme()" /></td>
	</tr>
</table>

</form>

</body>
</html>


